package com.itheima.dao;

import com.itheima.bean.Student;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;

public class ListStudent {
    public void listStudent(BufferedReader br ,ArrayList<Student> list) throws IOException {

        String line;
        while ((line = br.readLine()) != null) {
            Student stu = new Student();
            String[] arr = line.split(",");
            stu.setUsername(arr[0]);
            stu.setAge(Integer.parseInt(arr[1]));
            stu.setScore(Integer.parseInt(arr[2]));
            list.add(stu);
        }
    }
}
